import java.util.Vector;

class P583 {

	public static void main(String[] args) {
		createPrimes();
		primes[0] = 2;
		String line = readLn();
		while (!line.equals("0")) {
			System.out.print(line + " =");
			process(Integer.parseInt(line));
			line = readLn();
		}
		
		// generatePrimes();
		// for (int k = 0; k < 100; k++) {
		// System.out.println(primes[k]);
		// }
	}


	private static void process(int i) {
		Vector v = new Vector();
		
		if (i < 0) {
			v.addElement(new Integer(-1));
			i *= -1;
		}
		
		primeIndex = 0;
		int prime = primes[primeIndex];
		while (i != 1) {
			if (i < numberofprimes &&  primesBoolean[i]) {
				v.addElement(new Integer(i));
				break;
			}
			
			if (prime > Math.sqrt(i)) {
				v.addElement(new Integer(i));
				break;
			}

//			 4. If counter>=sqrt(X), stop and print X directly, remember divisibility property.
//			if (prime >= Math.sqrt(i)) {
//				v.addElement(new Integer(prime));
//				break;
//			}
			if (i % prime == 0) {
				i /= prime;
				Integer in = new Integer(prime);
				v.addElement(in);
//				if (prime >= Math.sqrt(i)) {
//				v.addElement(new Integer(prime));
//				break;
//				}
				// counter++;
			} else {
				prime = nextPrime();

				// counter++;
			}
		}

		int length = v.size() - 1;
		
		StringBuffer answer = new StringBuffer();
		
		for (int k = 0; k < length; k++) {
			answer.append(" " + v.elementAt(k) + " x");
		}
		
		answer.append(" " + v.elementAt(length));
		System.out.println(answer.toString());

	}

	static int numberofprimes = 1000000;

	static int[] primes = new int[numberofprimes];

	static int calculatedPrimes = 1;

	static int primeIndex = 2;

	static boolean[] primesBoolean = new boolean[numberofprimes];


	static void createPrimes() {
		int i, j;

//		for (i = 0; i < numberofprimes; i++) {
//			primesBoolean[i] = false;
//		}

		primesBoolean[2] = true;
		primesBoolean[3] = true;
		primes[0] = 2;
		primes[1] = 3;

		for (i = 5; i < numberofprimes; i += 2) {
			for (j = 3; j * j <= i; j += 2)
				if (i % j == 0)
					break;
			if (i % j != 0) {
				primesBoolean[i] = true;
				primes[primeIndex] = i;
				primeIndex++;
			}
		}
	}


	private static int nextPrime() {
		primeIndex++;
		return primes[primeIndex];
	}


	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}

	// static void generatePrimes() {
	// createPrimes();
	//	   
	// int i, j;
	//
	//
	// for (i = 2; i < numberofprimes; i++) {
	// if (isPrime(i)) {
	// primes[primeIndex] = i;
	// // System.out.println("prime: " + i);
	// primeIndex++;
	// }
	// }
	// }

}